summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatías Locatti <42481638+goldenx86@users.noreply.github.com>2023-02-27 23:38:36 +0100
committerGitHub <noreply@github.com>2023-02-27 23:38:36 +0100
commit5f2cbf53d71dcf25e4d62d803f3e6353319eefb5 (patch)
tree3bf312f0a9d462463d68eee1dd9d641e58a2131f
parentMerge pull request #9871 from yuzu-emu/revert-9824-burning-profiles (diff)
parentPartially apply LTO to only core and video_core projects. (diff)
downloadyuzu-5f2cbf53d71dcf25e4d62d803f3e6353319eefb5.tar
yuzu-5f2cbf53d71dcf25e4d62d803f3e6353319eefb5.tar.gz
yuzu-5f2cbf53d71dcf25e4d62d803f3e6353319eefb5.tar.bz2
yuzu-5f2cbf53d71dcf25e4d62d803f3e6353319eefb5.tar.lz
yuzu-5f2cbf53d71dcf25e4d62d803f3e6353319eefb5.tar.xz
yuzu-5f2cbf53d71dcf25e4d62d803f3e6353319eefb5.tar.zst
yuzu-5f2cbf53d71dcf25e4d62d803f3e6353319eefb5.zip
-rw-r--r--.ci/templates/build-msvc.yml2
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/video_core/CMakeLists.txt4
4 files changed, 11 insertions, 1 deletions
diff --git a/.ci/templates/build-msvc.yml b/.ci/templates/build-msvc.yml
index c379dd757..427028e08 100644
--- a/.ci/templates/build-msvc.yml
+++ b/.ci/templates/build-msvc.yml
@@ -9,7 +9,7 @@ parameters:
steps:
- script: choco install vulkan-sdk
displayName: 'Install vulkan-sdk'
-- script: refreshenv && mkdir build && cd build && cmake -E env CXXFLAGS="/Gw /GA /Gr /Ob2" cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_CRASH_DUMPS=ON .. && cd ..
+- script: refreshenv && mkdir build && cd build && cmake -E env CXXFLAGS="/Gw /GA /Gr /Ob2" cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_POLICY_DEFAULT_CMP0069=NEW -DENABLE_LTO=ON -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_SDL2=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DYUZU_TESTS=OFF -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON -DDISPLAY_VERSION=${{ parameters['version'] }} -DCMAKE_BUILD_TYPE=Release -DYUZU_CRASH_DUMPS=ON .. && cd ..
displayName: 'Configure CMake'
- task: MSBuild@1
displayName: 'Build'
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 10a3de9e2..274eebe8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,6 +56,8 @@ option(YUZU_USE_BUNDLED_VCPKG "Use vcpkg for yuzu dependencies" "${MSVC}")
option(YUZU_CHECK_SUBMODULES "Check if submodules are present" ON)
+option(YUZU_ENABLE_LTO "Enable link-time optimization" OFF)
+
CMAKE_DEPENDENT_OPTION(YUZU_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF)
if (YUZU_USE_BUNDLED_VCPKG)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index ff5502d87..70fa1edf5 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -861,3 +861,7 @@ endif()
if (YUZU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(core PRIVATE precompiled_headers.h)
endif()
+
+if (YUZU_ENABLE_LTO)
+ set_property(TARGET core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+endif()
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index 4742bcbe9..e904573d7 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -330,3 +330,7 @@ endif()
if (YUZU_USE_PRECOMPILED_HEADERS)
target_precompile_headers(video_core PRIVATE precompiled_headers.h)
endif()
+
+if (YUZU_ENABLE_LTO)
+ set_property(TARGET video_core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+endif()